package com.bed.lovewithpatientbed.dao;

import com.bed.lovewithpatientbed.pojo.Order;
import com.bed.lovewithpatientbed.pojo.OrderExample;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

public interface OrderDao {
    long countByExample(OrderExample example);

    int deleteByExample(OrderExample example);

    int deleteByPrimaryKey(Integer orderId);

    int insert(Order record);

    int insertSelective(Order record);

    List<Order> selectByExample(OrderExample example);

    Order selectByPrimaryKey(Integer orderId);

    int updateByExampleSelective(@Param("record") Order record, @Param("example") OrderExample example);

    int updateByExample(@Param("record") Order record, @Param("example") OrderExample example);

    int updateByPrimaryKeySelective(Order record);

    int updateByPrimaryKey(Order record);
    /*按照医院查询租金和*/
    BigDecimal selectRentByHospitalId(Integer HospitalId);
    /*按照医院查询订单数*/
    int selectOrderCountByHospitalId(Integer HospitalId);

    /**
     * @title selectOrderTotalPayByUserId
     * @description 根据 userId 查询该用户订单总金额
     * @author xuxiaoding
     * @param userId 用户id
     * @return 该用户订单总金额
     */
    BigDecimal selectOrderTotalPayByUserId(Integer userId);
}